package com.dahua.messagesyncbj.config.result;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

@Data
@NoArgsConstructor
public class ResultFA extends ResultVO {
    private static final String EXCEPTION = "exception";
    private static final String DESCRIPTION = "description";

    public ResultFA resultFA(int code, String message, String exception){
        Map<String,Object> ResultData = new HashMap<>();
        ResultData.put(EXCEPTION,exception);
        ResultFA resultFA = new ResultFA();
        resultFA.setCode(code);
        resultFA.setMessage(message);
        resultFA.setData(ResultData);
        return resultFA;
    }
    public ResultFA resultFA(int code, String message, String exception, Object data){
        ResultFA resultFA = new ResultFA();
        Map<String,Object> ResultData = new HashMap<>();
        ResultData.put(EXCEPTION,exception);
        ResultData.put(DESCRIPTION,data);
        resultFA.setCode(code);
        resultFA.setMessage(message);
        resultFA.setData(ResultData);
        return resultFA;
    }
}
